/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.STI.web;

import com.STI.jdbc.Connexion;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/**
 * Web application lifecycle listener.
 * @author Usager
 */
@WebListener()
public class ApplicationListener implements ServletContextListener {

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        //throw new UnsupportedOperationException("Not supported yet.");
        Connexion.setUrl(sce.getServletContext().getInitParameter("urlBd"));
        try {
            Class.forName(sce.getServletContext().getInitParameter("piloteJdbc"));
        } catch (ClassNotFoundException ex) {
            
        }
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
